package com.zengqingfa.thread.demo1;

import java.util.concurrent.*;

/**
 * @fileName: CreateThread4
 * @author: zengqf3
 * @date: 2020-10-7 11:24
 * @description:
 */
public class CreateThread4 implements Runnable {

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() + " i am coding ");
    }

    public static void main(String[] args) throws Exception {
        //创建执行服务
        ExecutorService service= Executors.newFixedThreadPool(3);
        CreateThread4 ct2 = new CreateThread4();
        Future<?> submit = service.submit(ct2);
        System.out.println("方式二：获取结果 "+submit.get());
    }

}
